<!DOCTYPE html>
<html lang="en-us">
  <head>
    
    <script type="application/ld+json">

{
  "@context": "https://schema.org",
  "@type": "BlogPosting",
  "headline": "Android_11_web",
  
  "datePublished": "2022-04-02T20:38:23+08:00",
  "dateModified": "2022-04-02T20:38:23+08:00",
  "author": {
    "@type": "Person",
    "name": "Zhang Gaojie",
    
    "image": "https://zgjoget9.github.io/img/avatar.jpg"
    
  },
  "mainEntityOfPage": { 
    "@type": "WebPage",
    "@id": "https:\/\/zgjoget9.github.io\/2022\/04\/android_11_web\/" 
  },
  "publisher": {
    "@type": "Organization",
    "name": "Zhang Gaojie",
    
    "logo": {
      "@type": "ImageObject",
      "url": "https://zgjoget9.github.io/img/avatar.jpg"
    }
    
  },
  "description": "看看精彩的世界，使用网络技术\n",
  "keywords": []
}

</script>
    <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Hugo 0.92.2 with theme Tranquilpeak 0.5.3-BETA">
<meta name="author" content="Zhang Gaojie">
<meta name="keywords" content="">
<meta name="description" content="看看精彩的世界，使用网络技术">


<meta property="og:description" content="看看精彩的世界，使用网络技术">
<meta property="og:type" content="article">
<meta property="og:title" content="Android_11_web">
<meta name="twitter:title" content="Android_11_web">
<meta property="og:url" content="https://zgjoget9.github.io/2022/04/android_11_web/">
<meta property="twitter:url" content="https://zgjoget9.github.io/2022/04/android_11_web/">
<meta property="og:site_name" content="Zhang Gaojie">
<meta property="og:description" content="看看精彩的世界，使用网络技术">
<meta name="twitter:description" content="看看精彩的世界，使用网络技术">
<meta property="og:locale" content="en-us">

  
    <meta property="article:published_time" content="2022-04-02T20:38:23">
  
  
    <meta property="article:modified_time" content="2022-04-02T20:38:23">
  
  
  
  


<meta name="twitter:card" content="summary">







  <meta property="og:image" content="https://zgjoget9.github.io/img/avatar.jpg">
  <meta property="twitter:image" content="https://zgjoget9.github.io/img/avatar.jpg">






    <title>Android_11_web</title>

    <link rel="icon" href="https://zgjoget9.github.io/favicon.png">
    

    

    <link rel="canonical" href="https://zgjoget9.github.io/2022/04/android_11_web/">

    
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w==" crossorigin="anonymous" referrerpolicy="no-referrer" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.css" integrity="sha512-H9jrZiiopUdsLpg94A333EfumgUBpO9MdbxStdeITo+KEIMaNfHNvwyjjDJb+ERPaRS6DpyRlKbvPUasNItRyw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
    
    
    
    <link rel="stylesheet" href="https://zgjoget9.github.io/css/style-h6ccsoet3mzkbb0wngshlfbaweimexgqcxj0h5hu4h82olsdzz6wmqdkajm.min.css" />
    
    

    
      
    
    
  </head>

  <body>
    <div id="blog">
      <header id="header" data-behavior="4">
  <i id="btn-open-sidebar" class="fa fa-lg fa-bars"></i>
  <div class="header-title">
    <a class="header-title-link" href="https://zgjoget9.github.io/" aria-label="Go to homepage">Zhang Gaojie</a>
  </div>
  
    
      <a class="header-right-picture "
         href="https://zgjoget9.github.io/#about" aria-label="Open the link: /#about">
    
    
    
      
        <img class="header-picture" src="https://zgjoget9.github.io/img/avatar.jpg" alt="Author&#39;s picture" />
      
    
    </a>
  
</header>

      <nav id="sidebar" data-behavior="4">
  <div class="sidebar-container">
    
      <div class="sidebar-profile">
        <a href="https://zgjoget9.github.io/#about" aria-label="Read more about the author">
          <img class="sidebar-profile-picture" src="https://zgjoget9.github.io/img/avatar.jpg" alt="Author&#39;s picture" />
        </a>
        <h4 class="sidebar-profile-name">Zhang Gaojie</h4>
        
          <h5 class="sidebar-profile-bio">A Computer-science and Cyber-security novice</h5>
        
      </div>
    
    <ul class="sidebar-buttons">
      
  <li class="sidebar-button">
    
      <a class="sidebar-button-link " href="https://zgjoget9.github.io/" title="Home">
    
      <i class="sidebar-button-icon fas fa-lg fa-home" aria-hidden="true"></i>
      
      <span class="sidebar-button-desc">Home</span>
    </a>
  </li>

  <li class="sidebar-button">
    
      <a class="sidebar-button-link " href="https://zgjoget9.github.io/categories" title="Categories">
    
      <i class="sidebar-button-icon fas fa-lg fa-bookmark" aria-hidden="true"></i>
      
      <span class="sidebar-button-desc">Categories</span>
    </a>
  </li>

  <li class="sidebar-button">
    
      <a class="sidebar-button-link " href="https://zgjoget9.github.io/tags" title="Tags">
    
      <i class="sidebar-button-icon fas fa-lg fa-tags" aria-hidden="true"></i>
      
      <span class="sidebar-button-desc">Tags</span>
    </a>
  </li>

  <li class="sidebar-button">
    
      <a class="sidebar-button-link " href="https://zgjoget9.github.io/archives" title="Archives">
    
      <i class="sidebar-button-icon fas fa-lg fa-archive" aria-hidden="true"></i>
      
      <span class="sidebar-button-desc">Archives</span>
    </a>
  </li>

  <li class="sidebar-button">
    
      <a class="sidebar-button-link " href="https://zgjoget9.github.io/#about" title="About">
    
      <i class="sidebar-button-icon fas fa-lg fa-question" aria-hidden="true"></i>
      
      <span class="sidebar-button-desc">About</span>
    </a>
  </li>


    </ul>
    <ul class="sidebar-buttons">
      
  <li class="sidebar-button">
    
      <a class="sidebar-button-link " href="https://github.com/zgjoget9" target="_blank" rel="noopener" title="GitHub">
    
      <i class="sidebar-button-icon fab fa-lg fa-github" aria-hidden="true"></i>
      
      <span class="sidebar-button-desc">GitHub</span>
    </a>
  </li>

  <li class="sidebar-button">
    
      <a class="sidebar-button-link " href="https://stackoverflow.com/users/18013715/jack-zhang" target="_blank" rel="noopener" title="Stack Overflow">
    
      <i class="sidebar-button-icon fab fa-lg fa-stack-overflow" aria-hidden="true"></i>
      
      <span class="sidebar-button-desc">Stack Overflow</span>
    </a>
  </li>


    </ul>
    <ul class="sidebar-buttons">
      

    </ul>
  </div>
</nav>

      

      <div id="main" data-behavior="4"
        class="
               hasCoverMetaIn
               ">
        <article class="post" id="top">
          
          
            <div class="post-header main-content-wrap text-left">
  
    <h1 class="post-title">
      Android_11_web
    </h1>
  
  
  <div class="postShorten-meta post-meta">
    
      <time datetime="2022-04-02T20:38:23&#43;08:00">
        
  April 2, 2022

      </time>
    
    
  </div>

</div>
          
          <div class="post-content markdown">
            <div class="main-content-wrap">
              <p>看看精彩的世界，使用网络技术</p>
<h2 id="webview的用法">WebView的用法</h2>
<p>Android提供了一个WebView控件，借助它我们可以在自己的应用程序里嵌入一个浏览器，从而非常轻松地展示各种各样的网页。</p>
<p>在布局文件中添加如下控件：</p>
<pre tabindex="0"><code>&lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    android:layout_width=&quot;match_parent&quot;
    android:layout_height=&quot;match_parent&quot; &gt;

    &lt;WebView
        android:id=&quot;@+id/webView&quot;
        android:layout_width=&quot;match_parent&quot;
        android:layout_height=&quot;match_parent&quot; /&gt;

&lt;/LinearLayout&gt;
</code></pre><p>然后在Activity中可以对WebView控件进行一些设置，如下所示：</p>
<pre tabindex="0"><code>class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        webView.settings.setJavaScriptEnabled(true)
        webView.webViewClient = WebViewClient()
        webView.loadUrl(&quot;https://www.baidu.com&quot;)
    }
    
}
</code></pre><h3 id="在androidmanifest文件中声明权限">在AndroidManifest文件中声明权限</h3>
<p>另外还需要注意，访问网络是需要声明权限的，因此我们还得修改AndroidManifest.xml文件，并加入权限声明。</p>
<pre tabindex="0"><code>&lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    package=&quot;com.example.webviewtest&quot;&gt;

    &lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&gt;
    
    ...
&lt;/manifest&gt;
</code></pre><p>最终的运行效果如下图所示。</p>
<p><img src="https://zgjoget9.github.io/img/web_1.png" alt="pic1"></p>
<h2 id="使用http访问网络">使用HTTP访问网络</h2>
<h3 id="使用httpurlconnection">使用HttpURLConnection</h3>
<p>首先需要获取HttpURLConnection的实例，如下所示：</p>
<p>val url = URL(&ldquo;<a href="https://www.baidu.com">https://www.baidu.com</a>&rdquo;)
val connection = url.openConnection() as HttpURLConnection</p>
<p>然后可以设置HTTP请求所使用的方法。常用的方法主要有两个：GET和POST。GET表示希望从服务器那里获取数据，而POST则表示希望提交数据给服务器。写法如下：
connection.requestMethod = &ldquo;GET&rdquo;</p>
<p>之后再调用getInputStream()方法可以获取到服务器返回的输入流，剩下的任务就是对输入流进行读取：
val input = connection.inputStream</p>
<p>最后调用disconnect()方法将这个HTTP连接关闭：
connection.disconnect()</p>
<h3 id="使用okhttp">使用OkHttp</h3>
<p>首先需要创建一个OkHttpClient的实例，如下所示：
val client = OkHttpClient()</p>
<p>接下来如果想要发起一条HTTP请求，就需要创建一个Request对象：
val request = Request.Builder().build()</p>
<p>还可以通过url()方法来设置目标的网络地址，如下所示：
val request = Request.Builder()
.url(&ldquo;<a href="https://www.baidu.com">https://www.baidu.com</a>&rdquo;)
.build()</p>
<p>之后调用newCall()方法来创建一个Call对象，并调用execute()方法来发送请求并获取返回的数据：
val response = client.newCall(request).execute()</p>
<p>其中Response对象就是服务器返回的数据了，我们可以使用如下写法来得到返回的具体内容：
val responseData = response.body?.string()</p>
<h2 id="解析json格式数据">解析JSON格式数据</h2>
<h3 id="服务器返回的json数据">服务器返回的JSON数据</h3>
<p>比如说服务器返回的JSON数据格式如下：</p>
<pre tabindex="0"><code>[{&quot;id&quot;:&quot;5&quot;,&quot;version&quot;:&quot;5.5&quot;,&quot;name&quot;:&quot;Clash of Clans&quot;},
{&quot;id&quot;:&quot;6&quot;,&quot;version&quot;:&quot;7.0&quot;,&quot;name&quot;:&quot;Boom Beach&quot;},
{&quot;id&quot;:&quot;7&quot;,&quot;version&quot;:&quot;3.5&quot;,&quot;name&quot;:&quot;Clash Royale&quot;}]
</code></pre><h3 id="使用jsonobject解析">使用JSONObject解析</h3>
<p>使用JSONObject解析数据的代码如下所示：</p>
<pre tabindex="0"><code> private fun parseJSONWithJSONObject(jsonData: String) {
        try {
            val jsonArray = JSONArray(jsonData)
            for (i in 0 until jsonArray.length()) {
                val jsonObject = jsonArray.getJSONObject(i)
                val id = jsonObject.getString(&quot;id&quot;)
                val name = jsonObject.getString(&quot;name&quot;)
                val version = jsonObject.getString(&quot;version&quot;)
                Log.d(&quot;MainActivity&quot;, &quot;id is $id&quot;)
                Log.d(&quot;MainActivity&quot;, &quot;name is $name&quot;)
                Log.d(&quot;MainActivity&quot;, &quot;version is $version&quot;)
            }
        } catch (e: Exception) {
            e.printStackTrace()
        }
    }
</code></pre><h3 id="使用gson解析">使用GSON解析</h3>
<p>使用GSON解析数据需要先定义一个实体类：
然后使用如下代码即可解析数据：</p>
<pre tabindex="0"><code> private fun parseJSONWithGSON(jsonData: String) {
        val gson = Gson()
        val typeOf = object : TypeToken&lt;List&lt;App&gt;&gt;() {}.type
        val appList = gson.fromJson&lt;List&lt;App&gt;&gt;(jsonData, typeOf)
        for (app in appList) {
            Log.d(&quot;MainActivity&quot;, &quot;id is ${app.id}&quot;)
            Log.d(&quot;MainActivity&quot;, &quot;name is ${app.name}&quot;)
            Log.d(&quot;MainActivity&quot;, &quot;version is ${app.version}&quot;)
        }
  }
</code></pre><h2 id="最好用的网络库retrofit">最好用的网络库：Retrofit</h2>
<h3 id="retrofit简介">Retrofit简介</h3>
<p>Retrofit是一款由Square公司开发的网络库，但是它和OkHttp的定位完全不同。</p>
<p>OkHttp侧重的是底层通信的实现，而Retrofit侧重的是上层接口的封装。</p>
<p>事实上，Retrofit就是Square公司在OkHttp的基础上进一步开发出来的应用层网络通信库，使得我们可以用更加面向对象的思维进行网络操作。</p>
<p>Retrofit的项目主页地址是：https://github.com/square/retrofit。</p>
<h3 id="retrofit的基本用法">Retrofit的基本用法</h3>
<p>要想使用Retrofit，我们需要先在项目中添加必要的依赖库。编辑app/build.gradle文件，在dependencies闭包中添加如下内容：</p>
<pre tabindex="0"><code>dependencies {
    …
    implementation 'com.squareup.retrofit2:retrofit:2.6.1'
    implementation 'com.squareup.retrofit2:converter-gson:2.6.1'
}
</code></pre><p>由于Retrofit会借助GSON将JSON数据转换成对象，因此这里同样需要新增一个App类，并加入id、name和version这3个字段，如下所示：
class App(val id: String, val name: String, val version: String)</p>
<p>新建AppService接口，代码如下所示：</p>
<pre tabindex="0"><code>interface AppService {
    @GET(&quot;get_data.json&quot;)
    fun getAppData(): Call&lt;List&lt;App&gt;&gt;
}
</code></pre><p>这里使用了一个@GET注解，表示当调用getAppData()方法时Retrofit会发起一条GET请求，请求的地址就是我们在@GET注解中传入的具体参数。</p>
<p>另外，getAppData()方法的返回值必须声明成Retrofit中内置的Call类型，并通过泛型来指定服务器响应的数据应该转换成什么对象。</p>
<p>最后，使用如下代码即可发起Retrofit请求：</p>
<pre tabindex="0"><code>            val retrofit = Retrofit.Builder()
                .baseUrl(&quot;http://10.0.2.2/&quot;)
                .addConverterFactory(GsonConverterFactory.create())
                .build()
            val appService = retrofit.create(AppService::class.java)
            appService.getAppData().enqueue(object : Callback&lt;List&lt;App&gt;&gt; {
                override fun onResponse(call: Call&lt;List&lt;App&gt;&gt;,
                    response: Response&lt;List&lt;App&gt;&gt;) {
                    val list = response.body()
                    if (list != null) {
                        for (app in list) {
                            Log.d(&quot;MainActivity&quot;, &quot;id is ${app.id}&quot;)
                            Log.d(&quot;MainActivity&quot;, &quot;name is ${app.name}&quot;)
                            Log.d(&quot;MainActivity&quot;, &quot;version is ${app.version}&quot;)
                        }
                    }
                }

                override fun onFailure(call: Call&lt;List&lt;App&gt;&gt;, t: Throwable) {
                    t.printStackTrace()
                }
            })
</code></pre><p>由于Retrofit相关的内容繁多，更详细的用法，请参考书中内容。</p>
<h2 id="kotlin">kotlin</h2>
<h3 id="协程的概念">协程的概念</h3>
<p>协程和线程是有点类似的，可以简单地将它理解成一种轻量级的线程。</p>
<p>要知道，我们之前所学习的线程是非常重量级的，它需要依靠操作系统的调度才能实现不同线程之间的切换。而使用协程却可以仅在编程语言的层面就能实现不同协程之间的切换，从而大大提升了并发编程的运行效率。</p>
<h3 id="协程的基本用法">协程的基本用法</h3>
<p>Kotlin并没有将协程纳入标准库的API当中，而是以依赖库的形式提供的。所以如果我们想要使用协程功能，需要先在app/build.gradle文件当中添加如下依赖库：</p>
<pre tabindex="0"><code>dependencies {
  ...
  implementation &quot;org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.1&quot;
  implementation &quot;org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.1&quot;
}
</code></pre><p>启动协程最简单的方式就是使用Global.launch函数，如下所示：</p>
<pre tabindex="0"><code>fun main() {
    GlobalScope.launch {
        println(&quot;codes run in coroutine scope&quot;)
    }
}
</code></pre><p>GlobalScope.launch函数可以创建一个协程的作用域，这样传递给launch函数的代码块（Lambda表达式）就是在协程中运行的了。</p>
<p>runBlocking函数也可以用于启动一个协程，并且会保证在协程作用域内的所有代码和子协程没有全部执行完之前一直阻塞当前线程。</p>
<pre tabindex="0"><code>fun main() {
    runBlocking {
        println(&quot;codes run in coroutine scope&quot;)
        delay(1500)
        println(&quot;codes run in coroutine scope finished&quot;)
    }
}
</code></pre><p>使用launch函数可以用于创建多个协程，如下所示：</p>
<pre tabindex="0"><code>fun main() {
    runBlocking {
        launch {
            println(&quot;launch1&quot;)
            delay(1000)
            println(&quot;launch1 finished&quot;)
        }
        launch {
            println(&quot;launch2&quot;)
            delay(1000)
            println(&quot;launch2 finished&quot;)
        }
    }
}
</code></pre><p>这里我们调用了两次launch函数，也就是创建了两个子协程。</p>
<p>协程允许我们在单线程模式下模拟多线程编程的效果，代码执行时的挂起与恢复完全是由编程语言来控制的，和操作系统无关。</p>
<p>这种特性使得高并发程序的运行效率得到了极大的提升，试想一下，开启10万个线程完全是不可想象的事吧？而开启10万个协程就是完全可行的。</p>
<p>由于协程相关的内容繁多，更详细的用法，请参考书中内容。</p>
              


            </div>
          </div>
          <div id="post-footer" class="post-footer main-content-wrap">
            
              
            
            
<div class="post-actions-wrap">
  <nav >
    <ul class="post-actions post-action-nav">
      
        <li class="post-action">
          
            <a class="post-action-btn btn btn--default tooltip--top" href="https://zgjoget9.github.io/2022/04/picgo/" data-tooltip="PicGo" aria-label="NEXT: PicGo">
          
              <i class="fa fa-angle-left"></i>
              <span class="hide-xs hide-sm text-small icon-ml">NEXT</span>
            </a>
        </li>
        <li class="post-action">
          
            <a class="post-action-btn btn btn--default tooltip--top" href="https://zgjoget9.github.io/2022/04/android_10_service/" data-tooltip="Android_10_service" aria-label="PREVIOUS: Android_10_service">
          
              <span class="hide-xs hide-sm text-small icon-mr">PREVIOUS</span>
              <i class="fa fa-angle-right"></i>
            </a>
        </li>
      
    </ul>
  </nav>
<ul class="post-actions post-action-share" >
  
    <li class="post-action hide-lg hide-md hide-sm">
      <a class="post-action-btn btn btn--default btn-open-shareoptions" href="#btn-open-shareoptions" aria-label="Share this post">
        <i class="fa fa-share-alt" aria-hidden="true"></i>
      </a>
    </li>
    
      <li class="post-action hide-xs">
        <a class="post-action-btn btn btn--default" target="new" href="https://www.facebook.com/sharer/sharer.php?u=https://zgjoget9.github.io/2022/04/android_11_web/" title="Share on Facebook" aria-label="Share on Facebook">
          <i class="fab fa-facebook-square" aria-hidden="true"></i>
        </a>
      </li>
    
      <li class="post-action hide-xs">
        <a class="post-action-btn btn btn--default" target="new" href="https://twitter.com/intent/tweet?text=https://zgjoget9.github.io/2022/04/android_11_web/" title="Share on Twitter" aria-label="Share on Twitter">
          <i class="fab fa-twitter" aria-hidden="true"></i>
        </a>
      </li>
    
      <li class="post-action hide-xs">
        <a class="post-action-btn btn btn--default" target="new" href="https://www.linkedin.com/sharing/share-offsite/?url=https://zgjoget9.github.io/2022/04/android_11_web/" title="Share on Linkedin" aria-label="Share on Linkedin">
          <i class="fab fa-linkedin" aria-hidden="true"></i>
        </a>
      </li>
    
  
  
    <li class="post-action">
      <a class="post-action-btn btn btn--default" href="#disqus_thread" aria-label="Leave a comment">
        <i class="far fa-comment"></i>
      </a>
    </li>
  
  <li class="post-action">
    
      <a class="post-action-btn btn btn--default" href="#top" aria-label="Back to top">
      <i class="fa fa-arrow-up" aria-hidden="true"></i>
    
    </a>
  </li>
</ul>
</div>


            
  
    <div id="disqus_thread">
      <noscript>Please enable JavaScript to view the comments powered by Disqus.</noscript>
    </div>
    <script type="text/javascript">
      var disqus_config = function() {
        this.page.url = 'https:\/\/zgjoget9.github.io\/2022\/04\/android_11_web\/';
        
          this.page.identifier = '\/2022\/04\/android_11_web\/'
        
      };
      (function() {
        
        
        if (["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1) {
          document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.';
          return;
        }
        var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
        var disqus_shortname = 'zgjoget9-github-io';
        dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
      })();
    </script>
  


          </div>
        </article>
        <footer id="footer" class="main-content-wrap">
  <span class="copyrights">
    &copy; 2022 Zhang Gaojie. All Rights Reserved
  </span>
</footer>

      </div>
      <div id="bottom-bar" class="post-bottom-bar" data-behavior="4">
        
<div class="post-actions-wrap">
  <nav >
    <ul class="post-actions post-action-nav">
      
        <li class="post-action">
          
            <a class="post-action-btn btn btn--default tooltip--top" href="https://zgjoget9.github.io/2022/04/picgo/" data-tooltip="PicGo" aria-label="NEXT: PicGo">
          
              <i class="fa fa-angle-left"></i>
              <span class="hide-xs hide-sm text-small icon-ml">NEXT</span>
            </a>
        </li>
        <li class="post-action">
          
            <a class="post-action-btn btn btn--default tooltip--top" href="https://zgjoget9.github.io/2022/04/android_10_service/" data-tooltip="Android_10_service" aria-label="PREVIOUS: Android_10_service">
          
              <span class="hide-xs hide-sm text-small icon-mr">PREVIOUS</span>
              <i class="fa fa-angle-right"></i>
            </a>
        </li>
      
    </ul>
  </nav>
<ul class="post-actions post-action-share" >
  
    <li class="post-action hide-lg hide-md hide-sm">
      <a class="post-action-btn btn btn--default btn-open-shareoptions" href="#btn-open-shareoptions" aria-label="Share this post">
        <i class="fa fa-share-alt" aria-hidden="true"></i>
      </a>
    </li>
    
      <li class="post-action hide-xs">
        <a class="post-action-btn btn btn--default" target="new" href="https://www.facebook.com/sharer/sharer.php?u=https://zgjoget9.github.io/2022/04/android_11_web/" title="Share on Facebook" aria-label="Share on Facebook">
          <i class="fab fa-facebook-square" aria-hidden="true"></i>
        </a>
      </li>
    
      <li class="post-action hide-xs">
        <a class="post-action-btn btn btn--default" target="new" href="https://twitter.com/intent/tweet?text=https://zgjoget9.github.io/2022/04/android_11_web/" title="Share on Twitter" aria-label="Share on Twitter">
          <i class="fab fa-twitter" aria-hidden="true"></i>
        </a>
      </li>
    
      <li class="post-action hide-xs">
        <a class="post-action-btn btn btn--default" target="new" href="https://www.linkedin.com/sharing/share-offsite/?url=https://zgjoget9.github.io/2022/04/android_11_web/" title="Share on Linkedin" aria-label="Share on Linkedin">
          <i class="fab fa-linkedin" aria-hidden="true"></i>
        </a>
      </li>
    
  
  
    <li class="post-action">
      <a class="post-action-btn btn btn--default" href="#disqus_thread" aria-label="Leave a comment">
        <i class="far fa-comment"></i>
      </a>
    </li>
  
  <li class="post-action">
    
      <a class="post-action-btn btn btn--default" href="#top" aria-label="Back to top">
      <i class="fa fa-arrow-up" aria-hidden="true"></i>
    
    </a>
  </li>
</ul>
</div>


      </div>
      
<div id="share-options-bar" class="share-options-bar" data-behavior="4">
  <i id="btn-close-shareoptions" class="fa fa-times"></i>
  <ul class="share-options">
    
      <li class="share-option">
        <a class="share-option-btn" target="new" href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fzgjoget9.github.io%2F2022%2F04%2Fandroid_11_web%2F" aria-label="Share on Facebook">
          <i class="fab fa-facebook-square" aria-hidden="true"></i><span>Share on Facebook</span>
        </a>
      </li>
    
      <li class="share-option">
        <a class="share-option-btn" target="new" href="https://twitter.com/intent/tweet?text=https%3A%2F%2Fzgjoget9.github.io%2F2022%2F04%2Fandroid_11_web%2F" aria-label="Share on Twitter">
          <i class="fab fa-twitter" aria-hidden="true"></i><span>Share on Twitter</span>
        </a>
      </li>
    
      <li class="share-option">
        <a class="share-option-btn" target="new" href="https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fzgjoget9.github.io%2F2022%2F04%2Fandroid_11_web%2F" aria-label="Share on Linkedin">
          <i class="fab fa-linkedin" aria-hidden="true"></i><span>Share on Linkedin</span>
        </a>
      </li>
    
  </ul>
</div>
<div id="share-options-mask" class="share-options-mask"></div>


    </div>
    
    <div id="about">
  <div id="about-card">
    <div id="about-btn-close">
      <i class="fa fa-times"></i>
    </div>
    
      <img id="about-card-picture" src="https://zgjoget9.github.io/img/avatar.jpg" alt="Author&#39;s picture" />
    
    <h4 id="about-card-name">Zhang Gaojie</h4>
    
      <div id="about-card-bio">A Computer-science and Cyber-security novice</div>
    
    
      <div id="about-card-job">
        <i class="fa fa-briefcase"></i>
        <br/>
        Huazhong University of Science and Technology
      </div>
    
    
      <div id="about-card-location">
        <i class="fa fa-map-marker-alt"></i>
        <br/>
        Wuhan, China
      </div>
    
  </div>
</div>

    

    
  
    
      <div id="cover" style="background-image:url('https://zgjoget9.github.io/images/cover.jpg');"></div>
    
  


    
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/highlight.min.js" integrity="sha512-z+/WWfyD5tccCukM4VvONpEtLmbAm5LDu7eKiyMQJ9m7OfPEDL7gENyDRL3Yfe8XAuGsS2fS4xSMnl6d30kqGQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.js" integrity="sha512-uURl+ZXMBrF4AwGaWmEetzrd+J5/8NRkWAvJx5sbPSSuOb0bZLqf+tOzniObO00BjHa/dD7gub9oCGMLPQHtQA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>


<script src="https://zgjoget9.github.io/js/script-yqzy9wdlzix4lbbwdnzvwx3egsne77earqmn73v9uno8aupuph8wfguccut.min.js"></script>


  
    <script async crossorigin="anonymous" defer integrity="sha512-gE8KAQyFIzV1C9+GZ8TKJHZS2s+n7EjNtC+IMRn1l5+WYJTHOODUM6JSjZhFhqXmc7bG8Av6XXpckA4tYhflnw==" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/languages/apache.min.js"></script>
  

  
    <script async crossorigin="anonymous" defer integrity="sha512-EWROca+bote+7Oaaar1F6y74iZj1r1F9rm/ly7o+/FwJopbBaWtsFDmaKoZDd3QiGU2pGacBirHJNivmGLYrow==" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/languages/go.min.js"></script>
  

  
    <script async crossorigin="anonymous" defer integrity="sha512-GDVzAn0wpx1yVtQsRWmFc6PhJiLBPdUic+h4GWgljBh904O3JU10fk9EKNpVyIoPqkFn54rgL2QBG4BmUTMpiQ==" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/languages/http.min.js"></script>
  

  
    <script async crossorigin="anonymous" defer integrity="sha512-UgZlma8NzkrDb/NWgmLIcTrH7i/CSnLLDRFqCSNF5NGPpjKmzyM25qcoXGOup8+cDakKyaiTDd7N4dyH4YT+IA==" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/languages/less.min.js"></script>
  

  
    <script async crossorigin="anonymous" defer integrity="sha512-lot9koe73sfXIrUvIPM/UEhuMciN56RPyBdOyZgfO53P2lkWyyXN7J+njcxIIBRV+nVDQeiWtiXg+bLAJZDTfg==" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/languages/nginx.min.js"></script>
  

  
    <script async crossorigin="anonymous" defer integrity="sha512-Zd3e7XxHP00TD0Imr0PIfeM0fl0v95kMWuhyAS3Wn1UTSXTkz0OhtRgBAr4JlmADRgiXr4x7lpeUdqaGN8xIog==" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/languages/puppet.min.js"></script>
  

  
    <script async crossorigin="anonymous" defer integrity="sha512-qtqDO052iXMSP+5d/aE/jMtL9vIIGvONgTJziC2K/ZIB1yEGa55WVxGE9/08rSQ62EoDifS9SWVGZ7ihSLhzMA==" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/languages/scss.min.js"></script>
  

  
    <script async crossorigin="anonymous" defer integrity="sha512-1NmkjnEDnwwwcu28KoQF8vs3oaPFokQHbmbtwGhFfeDsQZtVFI8zW2aE9O8yMYdpdyKV/5blE4pSWw4Z/Sv97w==" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/languages/stylus.min.js"></script>
  

  
    <script async crossorigin="anonymous" defer integrity="sha512-B2wSfruPjr8EJL6IIzQr1eAuDwrsfIfccNf/LCEdxELCgC/S/ZMt/Uvk80aD79m7IqOqW+Sw8nbkvha20yZpzg==" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/languages/swift.min.js"></script>
  

  
    <script async crossorigin="anonymous" defer integrity="sha512-28oDiQZGKUVN6wQ7PSLPNipOcmkCALXKwOi7bnkyFf8QiMZQxG9EQoy/iiNx6Zxj2cG2SbVa4dXKigQhu7GiFw==" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/languages/yaml.min.js"></script>
  


<script>
$(document).ready(function() {
  hljs.configure({ classPrefix: '', useBR: false });
  $('pre.code-highlight > code, pre > code').each(function(i, block) {
    if (!$(this).hasClass('codeblock')) {
      $(this).addClass('codeblock');
    }
    hljs.highlightBlock(block);
  });
});
</script>




    
  </body>
</html>

